package com.tally.common.enums;


public enum WeekEnum {

    MONDAY(1, "周一"),
    TUESDAY(2, "周二"),
    WEDNESDAY(3, "周三"),
    THURSDAY(4, "周四"),
    FRIDAY(5, "周五"),
    SATURDAY(6, "周六"),
    SUNDAY(7, "周日");

    private final int code;
    private final String msg;


    WeekEnum(int code, String msg) {
        this.msg = msg;
        this.code = code;
    }

    /**
     * 根据code 获取中文周数
     * @param code code
     * @return 中文周数
     */
    public static String getValue(int code){
        for (WeekEnum week : WeekEnum.values()){
            if ( week.code == code) {
                return week.msg;
            }
        }
        return "";
    }
}
